import 'package:json_annotation/json_annotation.dart';

part 'messege.g.dart';

@JsonSerializable()
class Messege extends Object {
  @JsonKey(name: 'chat')
  Chat chat;

  @JsonKey(name: 'invites')
  List<dynamic> invites;

  Messege(
    this.chat,
    this.invites,
  );

  factory Messege.fromJson(Map<String, dynamic> srcJson) =>
      _$MessegeFromJson(srcJson);
}

@JsonSerializable()
class Chat extends Object {
  @JsonKey(name: 'number')
  int number;

  @JsonKey(name: 'content')
  String content;

  @JsonKey(name: 'last_time')
  String lastTime;

  Chat(
    this.number,
    this.content,
    this.lastTime,
  );

  factory Chat.fromJson(Map<String, dynamic> srcJson) =>
      _$ChatFromJson(srcJson);
}
